<script lang='tsx'>
import { defineComponent } from 'vue';
import iconMap from '@/components/icon';
import icon from '@ant-design/icons-vue';

export default defineComponent({
  components: {
    icon,
  },
  props: {
    iconName: {
      type: String,
      default: 'MenuOutlined',
    },
  },
  setup: (props, context) => {
    const myComponent = iconMap.get(props.iconName);
    return () => <icon component={myComponent} />;
  },
});
</script>
